/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.powertalk3.server.DAO;

import cn.powertalk3.server.model.User;
import org.hibernate.Query;

/**
 *
 * @author mrgaolei
 */
public class UserDAO extends BaseDAO {

    public void save(User user) {
        super.save(user);
    }

    public User getUserByEmail(String email) {
        String hql = "from User u where u.email = ?";
        Query query = this.session.createQuery(hql);
        query = query.setParameter(0, email);
        User user = (User) query.uniqueResult();
        return user;
    }
}
